package org.wdj.token.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.wdj.token.entity.SysUser;

public interface SysUserMapper {
    //插入一条记录
    @Insert("insert into sys_user(username, password, user_role) values (#{username}, #{password}, #{userRole})")
    @Options(useGeneratedKeys = true, keyProperty = "userId")
    void insert(SysUser sysUser);

    //根据 username 查询用户信息
    @Select("select user_id, username, password, user_role from sys_user where username=#{username}")
    SysUser selectByUsername(String username);
}
